- name: check/create instance
  hosts: simple-koji-ci-dev.fedorainfracloud.org:simple-koji-ci-prod.fedorainfracloud.org
  gather_facts: False

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - /srv/private/ansible/vars.yml
   - /srv/web/infra/ansible/vars/fedora-cloud.yml
   - /srv/private/ansible/files/openstack/passwords.yml

  tasks:
  - import_tasks: "{{ tasks_path }}/persistent_cloud.yml"

  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"

- name: setup all the things
  hosts: simple-koji-ci-dev.fedorainfracloud.org:simple-koji-ci-prod.fedorainfracloud.org
  gather_facts: True
  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - /srv/private/ansible/vars.yml
   - /srv/private/ansible/files/openstack/passwords.yml
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  pre_tasks:
  - import_tasks: "{{ tasks_path }}/cloud_setup_basic.yml"

  - name: set hostname (required by some services, at least postfix need it)
    hostname: name="{{inventory_hostname}}"

  - import_tasks: "{{ tasks_path }}/yumrepos.yml"

  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"

  roles:
      # - base
  - rkhunter
  - nagios_client
  - role: simple-koji-ci
  - role: keytab/service
    service: simple-koji-ci
    owner_user: fedmsg

